/*
 *   Copyright (C) <2009> 
 *
 *   <Sandeep K Sinha>
 *   <Rishi B Agrawal> <Vineet Agarwal> <Rohit Vashist> <Rohit K Sharma> <Sneha Hendre> 
 *   
 *   <sandeepksinha@gmail.com> <rishi.b.agrawal@gmail.com> <checkout.vineet@gmail.com> 
 *   <rohit.k.vashist@gmail.com> <imreckless@gmail.com> <sneha.hendre@gmail.com>
 *
 *   This program is free software: you can redistribute it and/or modify it 
 *   under the terms of the GNU General Public License as published by the 
 *   Free Software Foundation, either version 3 of the License, or (at your 
 *   option) any later version->
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE->  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *    
 */

#ifndef _OHSM_U_H_
#define _OHSM_U_H_ 

#include <libxml/xmlmemory.h>
#include <libxml/parser.h>


//#define DEBUG
//#define REL_DEBUG
//#define ALL_DEBUG
//#define DEV_DEBUG

#define OHSM_NUMBER_OF_CRITERIAS 5
#define MAX_RULES 30
#define MAX_NGROUPS 100 
#define DEV_LEN 30
#define MINORBITS       20
#define MKDEV(ma,mi)    (((ma) << MINORBITS) | (mi))

#define DEBUG_DISP_SAM 1
#define DEBUG_DISP_INODES 2
#define DEBUG_DEMO 3

#define MAX_DEV_NAME_LEN 20 
#define MAX_TIER_ALLOWED 11
#define MINORBITS       20
#define MINORMASK       ((1U << MINORBITS) - 1)
#define MAJOR(dev)      ((dev)>>8)
#define MINOR(dev)      ((dev) & 0xff)
#define MKDEV(ma,mi)    (((ma) << MINORBITS) | (mi))

extern int ohsm_get_relocation_policy (char *);
extern int ohsm_get_allocation_policy (char *);
extern int ohsm_get_tier_device_info(char *);
extern int validate_tiers(xmlChar *,xmlNodePtr cur);
extern int validate_id(xmlChar *s);
extern int validate_key(xmlChar *s);
extern int validate_user( uid_t user);
extern int validate_group( gid_t group);
extern int ohsm_get_device_topology(char *);
struct ohsm_allocation_policy *allocpol;

#endif
